home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / libs / knowhow4 / context.cpp < prev    next >
C/C++ Source or Header  |  1994-10-10  |  1KB  |  64 lines

  1. #include "context.h"
  2. #include "formline.h"
  3.  
  4. Context::Context(rect STATUSPOS, int STATUSTYPE, char** STATUSSTRINGS,
  5.        int* STATUSLIST)
  6.     {
  7.     statusPos = STATUSPOS; statusType = STATUSTYPE;
  8.     statusStrings = STATUSSTRINGS;
  9.     statusList = STATUSLIST;
  10.     }
  11. ///////////////////////////
  12. void Context::showStatus(int pos, int pat)
  13.     {
  14.     switch(statusType)
  15.     {
  16.     case NO_STATUS: break;
  17.     case STRING_STATUS:
  18.         if(statusStrings != NULL)
  19.         {
  20.         FormLine status_line(BUTTON_BORDER);
  21.         status_line.outtextxy(statusPos.origin,
  22.              statusPos.corner.X, statusStrings[pos - 1], pat);
  23.         }
  24.         break;
  25.     case MEDIUM_ICON_STATUS:
  26.     case SMALL_ICON_STATUS:
  27.     case LARGE_ICON_STATUS:
  28.         if(statusList != NULL)
  29.         {
  30.         Icon icon(statusPos.origin, statusList[pos - 1], statusType,
  31.             BUTTON_BORDER);
  32.         icon.show();
  33.         }
  34.         break;
  35.     case PCX_STATUS:
  36.         if(statusStrings != NULL)
  37.         {
  38.         pcx_file_scr(statusStrings[pos - 1],
  39.                  screenLocLT(statusPos.origin));
  40.         }
  41.         break;
  42.     }
  43.  
  44.     }
  45. //////////////////////////
  46. /*
  47. void main()
  48.     {
  49.     if(!init_KNOW_HOW())
  50.         return;
  51.     setfillstyle(SOLID_FILL, pColorSet->colors.BAK_COLOR);
  52.     bar(0, 0, getmaxx(), getmaxy());
  53.  
  54.     int STATUS[] = { 1, 0 };
  55.     Context c(rect(10, 12, 70, 20),
  56.            LARGE_ICON_STATUS, NULL,
  57.            STATUS);
  58.  
  59.     c.showStatus(1, SHOW_BORDER, 19);
  60.  
  61.     close_KNOW_HOW();
  62.     closegraph();
  63.     }
  64. */